package com.bjpowernode.crm.workbench.service.impl;

import com.bjpowernode.crm.workbench.domain.Customer;
import com.bjpowernode.crm.workbench.mapper.CustomerMapper;
import com.bjpowernode.crm.workbench.service.CustomerService;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class CustomerServiceImpl implements CustomerService {

    /**
     * 访问客户数据
     */
    private CustomerMapper customerMapper;

    @Override
    public void addCustomer(Customer customer) {
        this.customerMapper.insertCustomer(customer);
    }

    @Override
    public void deleteCustomerById(String id) {
        this.customerMapper.deleteCustomerById(id);
    }

    @Override
    public List<String> queryNamesByKeyword(String keyword) {
        return this.customerMapper.selectNamesByKeyword(keyword);
    }

    @Override
    public String selectIdByName(String name) {
        return this.customerMapper.selectIdByName(name);
    }

    @Override
    public String queryNameById(String id) {
        return this.customerMapper.selectNameById(id);
    }

}
